/**
 * Created by li on 16-2-11.
 */

function getCiUser(str,key){
    var sessionArray = str.split('|');
    var arrLen = sessionArray.length;
    var flag = false;
    var offset = 0;
    for(var i=0;i<arrLen;i++){
        if(sessionArray[i].search(key)!=-1){
            flag=true;
            offset = i+1;
            break;
        }
    }
    if(!flag){
        return false;
    }
    return sessionArray[offset].substr(0,sessionArray[offset].lastIndexOf('}'));
}

exports.getUser=getCiUser;